﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 时间测试
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            using (var db = new Db())
            {
                string Name = txtName.Text;
                DateTime birth = Convert.ToDateTime(dateTimePicker1.Value);
                DateTime input = DateTime.Now;
                UserInfo u = new UserInfo();
                u.Birthday = birth;
                u.Name = Name;
                u.InputTime = input;
                db.UserInfo.Add(u);
                db.SaveChanges();
            }
        }
    }
}
